/*
 * Copyright (c)  2015~2020, xforceplus
 * All rights reserved.
 * Project:datacare-orm
 * Id: QueryCondition.java   2020-09-28 23-05-04
 * Author: Evan
 */
package cn.datacare.orm.query;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: 2015~2020
 * </p>
 * <p>
 * Company/Department: xforceplus
 * </p>
 *
 * @author Evan
 * <b>Creation Time:</b> 2020-09-28 23-05-04
 * @since V1.0
 */
public interface QueryCondition<T extends StringQuery> {

    /***
     *
     * @param  column
     * @param   value
     * @return  Query<T>
     */
    Query<T> andEq(String column, Object value);

    Query<T> andNotEq(String column, Object value);

    Query<T> andGreat(String column, Object value);

    Query<T> andGreatEq(String column, Object value);

    Query<T> andLess(String column, Object value);

    Query<T> andLessEq(String column, Object value);

    Query<T> andLike(String column, Object value);

    Query<T> andNotLike(String column, Object value);

    Query<T> andIsNull(String column);

    Query<T> andIsNotNull(String column);

    Query<T> andIn(String column, Collection<?> value);

    Query<T> andIn(String column, StrongValue value);

    Query<T> andNotIn(String column, Collection<?> value);

    Query<T> andNotIn(String column, StrongValue value);

    Query<T> andBetween(String column, Object value1, Object value2);

    Query<T> andNotBetween(String column, Object value1, Object value2);


    Query<T> orEq(String column, Object value);

    Query<T> orNotEq(String column, Object value);

    Query<T> orGreat(String column, Object value);

    Query<T> orGreatEq(String column, Object value);

    Query<T> orLess(String column, Object value);

    Query<T> orLessEq(String column, Object value);

    Query<T> orLike(String column, Object value);

    Query<T> orNotLike(String column, Object value);

    Query<T> orIsNull(String column);

    Query<T> orIsNotNull(String column);

    Query<T> orIn(String column, Collection<?> value);

    Query<T> orIn(String column, StrongValue value);

    Query<T> orNotIn(String column, Collection<?> value);

    Query<T> orNotIn(String column, StrongValue value);

    Query<T> orBetween(String column, Object value1, Object value2);

    Query<T> orNotBetween(String column, Object value1, Object value2);


    /**
     * 多条件组合 and
     *
     * @param condition
     * @return
     */

    Query<T> and(QueryCondition condition);

    /***
     * 多条件组合 or
     * @param condition
     * @return Query<T>
     */

    Query<T> or(QueryCondition condition);


    /**
     * 获取sql
     * @return  StringBuilder
     */
    StringBuilder getSql();

    /**
     * 设置sql
     * @param sql  StringBuilder
     */
    void setSql(StringBuilder sql);

    /***
     * 获取参数
     * @return List<Object>
     */
    List<Object> getParams();

    /***
     * 获取distinct
     * @return  Query<T> Query
     */
    Query<T> distinct();
}
